//引入模块
let express = require('express');
let bodyParser = require('body-parser');
let book = require('./router/book.js')
let home = require('./router/home.js')

//创建服务器
let app = express();
app.use(bodyParser.urlencoded({
     extended: false
}));
app.use(express.static('./view'));
//挂载路由
app.use('/book', book);
//监听端口
app.use('/', home);

//启动服务器
app.listen(52273, function () {
     console.log('服务器运行在 http://127.0.0.1:52273');
});
